package com.ffcs.web.utils;
import java.net.URLEncoder;

import org.apache.commons.codec.binary.Base64;

public class HttpClientUtil4Apache {
    public static void main(String[] args)  
    {  
        byte[] temp = Base64.encodeBase64("<?xml version=\"1.0\" encoding=\"UTF-8\"  standalone=\"yes\"?><Request><Head><TransactionID>000001</TransactionID><Token>6WvzmLksrKyi/iyR/w/JByYggKrWCGWi</Token><Source>EECP</Source><AccessToken>63616C6C72696E67252423402151414A494F303936343332</AccessToken></Head><Body><OrderAction>APPSUB</OrderAction><UserID>master@zhaotest</UserID><Password>asdasd</Password><PayType>1</PayType><Apps ><AppInfo AppID=\"140000680000000000000006\"  OfferID=\"14000169\"  RealMoney=\"10\" RenewTimes =\"1\"><Parameter Name=\"num\"  Value=\"1\" /><Parameter Name=\"LicenseNum\"  Value=\"5\"  /></AppInfo></Apps></Body></Request>".getBytes());  
        String tempStr = new String(temp);  
        System.out.println(URLEncoder.encode(tempStr));  
//        tempStr="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiICBzdGFuZGFsb25lPSJ5ZXMiPz48UmVxdWVzdD48SGVhZD48VHJhbnNhY3Rpb25JRD4wMDAwMDE8L1RyYW5zYWN0aW9uSUQ+PFRva2VuPjZXdnptTGtzckt5aS9peVIvdy9KQnlZZ2dLcldDR1dpPC9Ub2tlbj48U291cmNlPkVFQ1A8L1NvdXJjZT48QWNjZXNzVG9rZW4+NjM2MTZDNkM3MjY5NkU2NzI1MjQyMzQwMjE1MTQxNEE0OTRGMzAzOTM2MzQzMzMyPC9BY2Nlc3NUb2tlbj48L0hlYWQ+PEJvZHk+PE9yZGVyQWN0aW9uPkFQUFNVQjwvT3JkZXJBY3Rpb24+PFVzZXJJRD5tYXN0ZXJAemhhb3Rlc3Q8L1VzZXJJRD48UGFzc3dvcmQ+YXNkYXNkPC9QYXNzd29yZD48UGF5VHlwZT4xPC9QYXlUeXBlPjxBcHBzID48QXBwSW5mbyBBcHBJRD0iMTQwMDAwNjgwMDAwMDAwMDAwMDAwMDA2IiAgT2ZmZXJJRD0iMTQwMDAxNjkiICBSZWFsTW9uZXk9IjEwIiBSZW5ld1RpbWVzID0iMSI+PFBhcmFtZXRlciBOYW1lPSJudW0iICBWYWx1ZT0iMSIgLz48UGFyYW1ldGVyIE5hbWU9IkxpY2Vuc2VOdW0iICBWYWx1ZT0iNSIgIC8+PC9BcHBJbmZvPjwvQXBwcz48L0JvZHk+PC9SZXF1ZXN0Pg==";
        byte[] temp2 = Base64.decodeBase64(tempStr);  
        System.out.println(new String(temp2));  
    }  
}
